<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: ConnectionManager Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00052.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pro-methods">Protected Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">ConnectionManager Class Reference<div class="ingroups"><a class="el" href="a00517.html">connectionManager - channel and connection related classes</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="ConnectionManager" --><!-- doxytag: inherits="BaseConnectionManager" -->
<p><a class="el" href="a00019.html" title="Module to control the channel and handle all connection related stuff.">BaseConnectionManager</a> implementation which only defines a specific max interference distance.  
 <a href="a00052.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00247_source.html">ConnectionManager.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ConnectionManager:</div>
<div class="dyncontent">
<div class="center"><img src="a00648.png" border="0" usemap="#ConnectionManager_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for ConnectionManager:</div>
<div class="dyncontent">
<div class="center"><img src="a00649.png" border="0" usemap="#ConnectionManager_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00650.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00052.html#abeb688210449aa6a62cb9cd76e5cfeaa">calcInterfDist</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate interference distance.  <a href="#abeb688210449aa6a62cb9cd76e5cfeaa"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p><a class="el" href="a00019.html" title="Module to control the channel and handle all connection related stuff.">BaseConnectionManager</a> implementation which only defines a specific max interference distance. </p>
<p>Calculates the maximum interference distance based on the transmitter power, wavelength, pathloss coefficient and a threshold for the minimal receive Power. </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="abeb688210449aa6a62cb9cd76e5cfeaa"></a><!-- doxytag: member="ConnectionManager::calcInterfDist" ref="abeb688210449aa6a62cb9cd76e5cfeaa" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double ConnectionManager::calcInterfDist </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Calculate interference distance. </p>
<p>Calculation of the interference distance based on the transmitter power, wavelength, pathloss coefficient and a threshold for the minimal receive Power</p>
<p>You may want to overwrite this function in order to do your own interference calculation </p>

<p>Implements <a class="el" href="a00019.html#a00b2487d2565c70a46101964a2767643">BaseConnectionManager</a>.</p>

<p>Reimplemented in <a class="el" href="a00221.html#ae83d638608dcf8d6267f3673792b914c">UnitDisk</a>.</p>

<p>References <a class="el" href="a00030.html#a84d040f815027b3098451b02733ac63d">BaseWorldUtility::speedOfLight</a>.</p>
<div class="fragment"><pre class="fragment">{
    <span class="keywordtype">double</span> interfDistance;

    <span class="comment">//the minimum carrier frequency for this cell</span>
    <span class="keywordtype">double</span> carrierFrequency = par(<span class="stringliteral">&quot;carrierFrequency&quot;</span>).doubleValue();
    <span class="comment">//maximum transmission power possible</span>
    <span class="keywordtype">double</span> pMax = par(<span class="stringliteral">&quot;pMax&quot;</span>).doubleValue();
  <span class="keywordflow">if</span> (pMax &lt;=0) {
        error(<span class="stringliteral">&quot;Max transmission power is &lt;=0!&quot;</span>);
    }
    <span class="comment">//minimum signal attenuation threshold</span>
    <span class="keywordtype">double</span> sat = par(<span class="stringliteral">&quot;sat&quot;</span>).doubleValue();
    <span class="comment">//minimum path loss coefficient</span>
    <span class="keywordtype">double</span> alpha = par(<span class="stringliteral">&quot;alpha&quot;</span>).doubleValue();

    <span class="keywordtype">double</span> waveLength = (<a class="code" href="a00030.html#a84d040f815027b3098451b02733ac63d" title="Speed of light in meters per second.">BaseWorldUtility::speedOfLight</a> / carrierFrequency);
    <span class="comment">//minimum power level to be able to physically receive a signal</span>
    <span class="keywordtype">double</span> minReceivePower = pow(10.0, sat / 10.0);

  interfDistance = pow(waveLength * waveLength * pMax
                 / (16.0*M_PI*M_PI*minReceivePower),
               1.0 / alpha);

    ccEV &lt;&lt; <span class="stringliteral">&quot;max interference distance:&quot;</span> &lt;&lt; interfDistance &lt;&lt; endl;

    <span class="keywordflow">return</span> interfDistance;
}
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/connectionManager/<a class="el" href="a00247_source.html">ConnectionManager.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/connectionManager/ConnectionManager.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00052.html">ConnectionManager</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:31 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
